using System;
using System.Collections.Generic;
using System.Text;
using Jbe.TestSuite.TestDevice.Manager;
using Jbe.TestSuite.TestDevice.Manager.Interface.Services;
using Jbe.TestSuite.TestDevice.Manager.Views;
using Microsoft.Practices.ObjectBuilder;

namespace Jbe.TestSuite.TestDevice.Manager.Tests.Mocks
{
    public class MockTestDevicesView : ITestDevicesView
    {
        private TestDevicesViewPresenter presenter;

        public IList<IControlView> DeviceControllers = null;

        [CreateNew]
        public TestDevicesViewPresenter Presenter
        {
            set 
            { 
                presenter = value;
                presenter.View = this;
                presenter.OnViewReady();
            }
        }

        public void SetSelectedDeviceControllers(IList<IControlView> deviceControllers)
        {
            presenter.UpdateSelectedControlViews(deviceControllers);
        }

        public void UpdateControlViews(IList<IControlView> deviceControllers)
        {
            DeviceControllers = deviceControllers;
        }
    }
}
